package chpt04.abstractshapes;

public class AbstratShapeTest {

	public static void main(String[] args) {
		AbstractShape[] shapes = new AbstractShape[2];
		shapes[0] = new Circle(10);
		shapes[1] = new Rectangle(10, 10);
		double area = 0.0;
		for (AbstractShape e : shapes) {
			area += e.getArea();
		}
		System.out.println("Shapes数组中的所有形状之和是：" + area);
		Object o = new Object();
		// shapes[0] = new AbstractShape(); // Cannot instantiate the type AbstractShape
		// System.out.println("Shapes数组中的所有形状之和是："+AbstractShape.sum(shapes));

	}

}
